﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QuizAppMvc2.Models.AvaliacaoModels>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Prova</h2>
    <% using (Html.BeginForm("Finish", "Setup", "Finish"))
       { %>
    <p>
        <% for (int i = 0; i < Model.questoes.Count; i++)
           { %>
        <%= i %>
        )
        <% if (Model.questoes[i].Questao.TipoQuestao == 1)
           {%>
        <%= (Model.questoes[i].Questao as QuizAppMvc2.QuestaoSimple).Texto%>
        <%--        <%=  Html.HiddenFor(m => m.questoes[i].idquestao)%>
        <%=  Html.RadioButtonFor(m => m.questoes[i].resposta, 1)%>certo<br />
        <%=  Html.RadioButtonFor(m => m.questoes[i].resposta, 2)%>errado<br />--%>
        <%=  Html.HiddenFor(m => m.questoes[i].idQuestao)%><br />
        <%=  Html.RadioButtonFor(m => m.questoes[i].Resultado, 1)%>certo<br />
        <%=  Html.RadioButtonFor(m => m.questoes[i].Resultado, 2)%>errado<br />
        <% } %>
        <% else if (Model.questoes[i].Questao.TipoQuestao == 2)
           { %>
        <%= (Model.questoes[i].Questao as QuizAppMvc2.QuestaoMultipla).Texto%><br>
        <%=  Html.HiddenFor(m => m.questoes[i].idQuestao)%>
        <%
               QuizAppMvc2.QuestaoMultipla qm = Model.questoes[i].Questao as QuizAppMvc2.QuestaoMultipla;
               int x = 1;
               foreach (QuizAppMvc2.QuestaoAlternativa alternativa in qm.QuestaoAlternativas)
               {
        %>
        <%=  Html.RadioButtonFor(m => m.questoes[i].Resultado, x++)%>
        <%=alternativa.Texto%><br />
        <% } %>
        <% } %>
        <br />
        <br />
        <% } %>
        <input type="submit" value="Finish" />
        <% } %>
    </p>
</asp:Content>
